package com.sch.study.concurrency.baseThread;

/**
 * User: hui_stone
 * Date: 2016/2/24 0024
 * Time: 下午 16:05
 */
public class MyRunnable implements Runnable{

    private int ticket=10;
    @Override
    public void run() {
        for(int i=0;i<20;i++){
            if(this.ticket>0){
                System.out.println(Thread.currentThread().getName()+" 卖票：ticket"+this.ticket--);
            }
        }
    }
}
